Skip to content

feat(pds): implement com.atproto.sync.listReposByCollection#178

Merged
ascorbic merged 2 commits into
mainfrom
feat/sync-list-repos-by-collection
May 24, 2026
Merged

feat(pds): implement com.atproto.sync.listReposByCollection#178
ascorbic merged 2 commits into
mainfrom
feat/sync-list-repos-by-collection

Conversation

@ascorbic
Copy link
Copy Markdown
Owner

Summary

  • Implements com.atproto.sync.listReposByCollection. Relays/crawlers hit this to discover which PDSes host repos for a given collection.
  • Adds rpcHasRecordsInCollection on AccountDurableObject, backed by the existing collections SQLite cache (with the same lazy backfill rpcDescribeRepo already uses) so we never walk the MST on a hot path.
  • New XRPC handler validates collection (required, must be a valid NSID via isNsid) and returns { repos: [{ did: env.DID }] } when the repo has any record in that collection, or { repos: [] } otherwise. No cursor — single-account PDS, optional per lexicon.
  • Route registered next to the other sync.* endpoints; no auth (public per lexicon).
  • Changeset (minor for @getcirrus/pds).

Test plan

  • New test/list-repos-by-collection.test.ts covers: collection with records returns our DID; empty collection returns []; missing collection returns 400 InvalidRequest; invalid NSID returns 400 InvalidRequest.
  • pnpm --filter @getcirrus/pds test (296 unit + 84 cli, all passing).
  • pnpm --filter @getcirrus/pds check clean.

Relays use this endpoint to discover which PDSes host repos for a given
collection. Cirrus is single-account, so the answer reduces to "does
our repo contain any record in the requested collection?". Uses the
existing `collections` SQLite cache (with the same lazy backfill as
`rpcDescribeRepo`) to answer without walking the MST.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
pdscheck 639a497 May 24 2026, 07:53 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
atproto-pds 639a497 May 24 2026, 07:53 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
cirrusdocs 639a497 Commit Preview URL

Branch Preview URL
May 24 2026, 07:53 PM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/create-pds@178
npm i https://pkg.pr.new/@getcirrus/oauth-provider@178
npm i https://pkg.pr.new/@getcirrus/pds@178

commit: 639a497

@ascorbic ascorbic merged commit aceda62 into main May 24, 2026
7 checks passed
@ascorbic ascorbic deleted the feat/sync-list-repos-by-collection branch May 24, 2026 19:54
@mixie-bot mixie-bot Bot mentioned this pull request May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant